<?php

include _FLEP_INCLUDE_DIR_.'html_search.inc.php';
include _FLEP_INCLUDE_DIR_.'html_message.inc.php';
include _FLEP_INCLUDE_DIR_.'html_navigation.inc.php';
include _FLEP_INCLUDE_DIR_.'html_menu.inc.php';
include _FLEP_INCLUDE_DIR_.'html_table_list.inc.php';
include _FLEP_INCLUDE_DIR_.'settings_html.inc.php';

$flep_page_info['css'] = array('common.css', 'main.css', 'aside.css', 'float_menu.css', 'page.css', 'table.css', 'lightbox.css', 'form_save.css');
$flep_page_info['js'] = array('common.js', 'ajax.js', 'request.js', 'lightbox.js', 'search.js', 'settings.js');
$flep_page_info['title'] = 'Idiomas - FLEP';
$flep_page_info['menu_title'] = 'Idiomas';
$flep_page_info['menu_items'] = array('<label onclick="flep_page_request(\'add_idioma\')">Nuevo Idioma</label>');
$flep_page_info['search_page'] = 'idioma';

$_SESSION['on_delete']['idioma'] = $_SERVER['REQUEST_URI'];
$_SESSION['on_save']['idioma'] = $_SERVER['REQUEST_URI'];

$structure = flep_html_search_init('idioma');
$structure['table_headers'] = array('N&deg;', 'Idioma', '', '');
$structure['table_indexes'] = array('idioma');
$structure['table_actions'] = array(
  '<img src="request.php?res=edit.png" onclick="flep_page_request(\'add_idioma\', \'%s\')" title="Modificar">',
  '<a href="delete.php?type=idioma&id=%s"><img src="request.php?res=delete.png" title="Eliminar"></a>'
);
$structure['table_error'] = 'No se han encontrado idiomas.';

flep_html_base_header($flep_page_info);
echo '<div class="aside">';
flep_settings_menu();
echo '</div>';
echo '<div class="bside">';

if(flep_get($_SESSION['user'], 'administrador') !== '1'){
  echo _FLEP_ACCESS_DENIED_MSG_;
} else {
  flep_html_menu_search($flep_page_info);
  echo '<table>';
  flep_settings_html_table_data($structure);
  echo '</table>';
}
echo '</div>';
flep_html_base_footer();
?>
